package cn.iocoder.yudao.module.biz.dal.mysql.risk.riskPointType;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.biz.controller.admin.risk.riskPointType.vo.BizRiskPointTypeExportReqVO;
import cn.iocoder.yudao.module.biz.controller.admin.risk.riskPointType.vo.BizRiskPointTypePageReqVO;
import cn.iocoder.yudao.module.biz.dal.dataobject.risk.riskPointType.BizRiskPointTypeDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 风险点类型 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface BizRiskPointTypeMapper extends BaseMapperX<BizRiskPointTypeDO> {

    default PageResult<BizRiskPointTypeDO> selectPage(BizRiskPointTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BizRiskPointTypeDO>()
                .likeIfPresent(BizRiskPointTypeDO::getRiskPointType, reqVO.getRiskPointType())
                .eqIfPresent(BizRiskPointTypeDO::getDeptId, SecurityFrameworkUtils.getLoginUser().getDeptId())
                .orderByDesc(BizRiskPointTypeDO::getCreateTime));
    }

    default List<BizRiskPointTypeDO> selectList(BizRiskPointTypeExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BizRiskPointTypeDO>()
                .likeIfPresent(BizRiskPointTypeDO::getRiskPointType, reqVO.getRiskPointType())
                .eqIfPresent(BizRiskPointTypeDO::getDeptId, SecurityFrameworkUtils.getLoginUser().getDeptId())
                .orderByDesc(BizRiskPointTypeDO::getCreateTime));
    }

}
